﻿Imports System.IO

Public Class frmNewProduct

    Private Sub frmNewProduct_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'loadExchange()
    End Sub

    'Private Sub loadExchange()
    '    Dim sql = "select * from tbl_exchange_rate_detail where exchange_rate_id=1"
    '    cboexchange.DisplayMember = "currency_name"
    '    cboexchange.ValueMember = "exchange_rate_detail_id"
    '    cboexchange.DataSource = Cmd.ExecuteDataTable(sql)
    'End Sub

    Private Sub cboexchange_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        'MessageBox.Show(cboexchange.SelectedValue)
    End Sub

    Private Sub btnbrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnbrowse.Click
        Dim ofd As New OpenFileDialog
        ofd.Filter = "jpeg|*.jpg|bmp|*.bmp|all files|*.*"
        If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
            Me.PictureBox1.Image = System.Drawing.Image.FromFile(ofd.FileName)
        End If
    End Sub

    Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
        'If txtcode.Text.Trim = "" Then
        '    myMsgbox.show("Code cannot be empty!!!", "New Item")
        '    txtcode.Focus()
        '    txtcode.SelectAll()
        '    Exit Sub
        'ElseIf IsNumeric(txtcode.Text) = False Then
        '    myMsgbox.show("Code must be integer number!!!", "New Item")
        '    txtcode.Focus()
        '    txtcode.SelectAll()
        '    Exit Sub
        'End If
        'If txtname.Text.Trim = "" Then
        '    myMsgbox.show("Name cannot be empty!!!", "New Item")
        '    txtname.Focus()
        '    txtname.SelectAll()
        '    Exit Sub
        'End If
        'If IsInteger(txtalert.Text) = False Then
        '    myMsgbox.show("", "New Item")
        '    txtalert.Focus()
        '    txtalert.SelectAll()
        '    Exit Sub
        'End If

        'ClassStock.addProduct(txtcode.Text, txtname.Text, txtalert.Text, PictureBox1.Image)
        Me.DialogResult = Windows.Forms.DialogResult.OK

    End Sub

    Private Sub btncancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncancel.Click
        Me.Close()
    End Sub
End Class